<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import = "org.json.simple.*, java.util.TreeMap, com.classes.Casemast, java.util.ArrayList, com.classes.CaseOutlet, com.classes.Outlet" %>
<%@ page import = "com.mbbmap.util.Constants" %>
<%@ page import = "com.mbbmap.security.dao.*" %>
<%@ include file="/jsp/map/include/user-dao.jsp" %>	
<%

// business detail
String app_type = "";
String ownership_status = "";
String reg_name = "";
String reg_no = "";
String desc = "";
String mcc_code = "";
String paid_up_capital = "";
String recall_barcode = "";
String year_in_business = "";
String avg_ticket_size = "";
String curr_acquirer = "";
String curr_bank = "";
String curr_acc_no = "";
String curr_avg_deposit = "0.00";
String curr_avg_deposit_dtl = "";
String amex_auth_sign = "";
ArrayList<TreeMap<String, String>> avg_deposit_dtl = new ArrayList<TreeMap<String, String>>();
ArrayList<TreeMap<String, String>> amex_entries = new ArrayList<TreeMap<String, String>>();

if(request.getAttribute("m_case") != null) {
	app_type = ((Casemast)request.getAttribute("m_case")).getType();
	ownership_status = ((Casemast)request.getAttribute("m_case")).getMerchant().getOwnershipStatus();
	reg_name = ((Casemast)request.getAttribute("m_case")).getMerchant().getRegisteredName();
	reg_no = ((Casemast)request.getAttribute("m_case")).getMerchant().getRegisteredNo();
	desc = ((Casemast)request.getAttribute("m_case")).getMerchant().getDesc();
	mcc_code = ((Casemast)request.getAttribute("m_case")).getMerchant().getMCCCode();
	paid_up_capital = ((Casemast)request.getAttribute("m_case")).getMerchant().getPaidUpCapital();
	recall_barcode = ((Casemast)request.getAttribute("m_case")).getMerchant().getRecallBarcode();
	rmcd_approval_no = ((Casemast)request.getAttribute("m_case")).getMerchant().getRmcd_approval_no();
	gst_registration = ((Casemast)request.getAttribute("m_case")).getMerchant().getGst_registration();
	year_in_business = ((Casemast)request.getAttribute("m_case")).getMerchant().getYearInBusiness();
	avg_ticket_size = ((Casemast)request.getAttribute("m_case")).getMerchant().getAvgTicketSize();
	curr_acquirer = ((Casemast)request.getAttribute("m_case")).getAcquirer();
	curr_bank = ((Casemast)request.getAttribute("m_case")).getMerchant().getCurrBank();
	curr_acc_no = ((Casemast)request.getAttribute("m_case")).getMerchant().getCurrAccNo();
	curr_avg_deposit = ((Casemast)request.getAttribute("m_case")).getMerchant().getCurrAvgDeposit();
	curr_avg_deposit_dtl = ((Casemast)request.getAttribute("m_case")).getMerchant().getCurrAvgDepositDtl();
	amex_auth_sign = ((Casemast)request.getAttribute("m_case")).getMerchant().getAmexAuthSign();
	
	
	JSONArray avg_deposit_arr = (JSONArray) JSONValue.parse(curr_avg_deposit_dtl);
	for(int k = 0; k < avg_deposit_arr.size(); k++) {
		String string = avg_deposit_arr.get(k).toString();
		JSONObject obj = (JSONObject)JSONValue.parse(string);
		TreeMap<String, String> temp = new TreeMap<String, String>();
		
		String month = (obj.get("month") == null) ? "" : obj.get("month").toString().trim();
		String total_deposit = (obj.get("total_deposit") == null) ? "" : obj.get("total_deposit").toString().trim();
		String balance = (obj.get("balance") == null) ? "" : obj.get("balance").toString().trim();
		
		temp.put("month", month);
		temp.put("total_deposit", total_deposit);
		temp.put("balance", balance);
		
		avg_deposit_dtl.add(temp);
	}
	
	
	JSONArray amex_auth_sign_arr = (JSONArray) JSONValue.parse(amex_auth_sign);
	for(int k = 0; k < amex_auth_sign_arr.size(); k++) {
		String string = amex_auth_sign_arr.get(k).toString();
		JSONObject obj = (JSONObject)JSONValue.parse(string);
		TreeMap<String, String> temp = new TreeMap<String, String>();
		
		String title = (obj.get("title") == null) ? "" : obj.get("title").toString().trim();
		String name = (obj.get("name") == null) ? "" : obj.get("name").toString().trim();
		String designation = (obj.get("designation") == null) ? "" : obj.get("designation").toString().trim();
		String ic_no = (obj.get("ic_no") == null) ? "" : obj.get("ic_no").toString().trim();
		String date_of_birth = (obj.get("date_of_birth") == null) ? "" : obj.get("date_of_birth").toString().trim();
		String gender = (obj.get("gender") == null) ? "" : obj.get("gender").toString().trim();
		
		temp.put("title", title);
		temp.put("name", name);
		temp.put("designation", designation);
		temp.put("ic", ic_no);
		temp.put("dob", date_of_birth);
		temp.put("gender", gender);
		
		amex_entries.add(temp);
	}
}


// match trace
long merchant_id = 0;
long case_id = 0;
String match_trace = "";

if(request.getAttribute("m_case") != null) {
	merchant_id = ((Casemast)request.getAttribute("m_case")).getMerchant().getId();
	case_id = ((Casemast)request.getAttribute("m_case")).getId();
	app_type = ((Casemast)request.getAttribute("m_case")).getType();
	ownership_status = ((Casemast)request.getAttribute("m_case")).getMerchant().getOwnershipStatus();
	match_trace = ((Casemast)request.getAttribute("m_case")).getMerchant().getMatchTrace();
}

String nationality_opt = "<option value='MYS'>MALAYSIA</option>"
		   + "<option value='AUS'>AUSTRIALIA</option>"
		   + "<option value='BRN'>BRUNEI</option>"
		   + "<option value='KHM'>CAMBODIA</option>"
		   + "<option value='CHN'>CHINA</option>"
		   + "<option value='HKG'>HONG KONG</option>"
		   + "<option value='IND'>INDIA</option>"
		   + "<option value='IDN'>INDONESIA</option>"
		   + "<option value='JPN'>JAPAN</option>"
		   + "<option value='KOR'>KOREA</option>"
		   + "<option value='MMR'>MYANMAR</option>"
		   + "<option value='NZL'>NEW ZEALAND</option>"
		   + "<option value='PAK'>PAKISTAN</option>"
		   + "<option value='PHL'>PHILIPPINES</option>"
		   + "<option value='PRT'>PORTUGAL</option>"
		   + "<option value='SGP'>SINGAPORE</option>"
		   + "<option value='LKA'>SRI LANKA</option>"
		   + "<option value='TWN'>TAIWAN</option>"
		   + "<option value='THA'>THAILAND</option>"
		   + "<option value='GBR'>UNITED KINGDOM</option>"
		   + "<option value='USA'>UNITED STATE</option>"
		   + "<option value='VNM'>VIETNAM</option>"
		   + "<option value=''>OTHER</option>";

// Outlet Detail
String name = "";
String contact_person = "";
String designation = "";
String email = "";
String tel_no = "";
String fax_no = "";
String esa_ref_no = "";
String no_of_terminal = "00";
String terminal_rental = "";
String terminal_owner = "";
String license_no = "";
String license_type = "";
String state = "";
String issuer = "";
String expiry = "";
String risk_level = "";
String trm_deposit_wired = "";
String trm_deposit_wireless = "";
String trm_rental_deposit_wired = "";
String trm_rental_deposit_wireless = "";
String trm_rental_advance = "";
String cheque_amt = "";
String bank_issuer = "";
String bank_branch = "";
String cheque_no = "";
String cheque_date = "";
String terminal_id = "";
String terminal_id_no = "";
String terminal_install_date = "";

if(request.getAttribute("m_case") != null) {
	reg_name = ((Casemast)request.getAttribute("m_case")).getMerchant().getRegisteredName();
	reg_no = ((Casemast)request.getAttribute("m_case")).getMerchant().getRegisteredNo();
}

if(request.getAttribute("c_outlet") != null) {
	reg_name = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getMerchant().getRegisteredName();
	reg_no = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getMerchant().getRegisteredNo();
	name = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getName();
	contact_person = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getCTName();
	designation = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getCTDesignation();
	email = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getCTEmail();
	tel_no = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getCTTel();
	fax_no = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getCTFax();
	esa_ref_no = ((CaseOutlet)request.getAttribute("c_outlet")).getESARefNo();
	no_of_terminal = ((CaseOutlet)request.getAttribute("c_outlet")).getNumTerminal();
	no_of_terminal = String.format("%02d", Integer.parseInt(no_of_terminal));
	terminal_rental = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmRental();
	terminal_owner = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmOwner();
	license_no = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getLisenceNo();
	license_type = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getLicenseType();
	state = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getLicenseState();
	issuer = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getLicenseIssuer();
	expiry = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getLicenseExpiry();
	risk_level = ((CaseOutlet)request.getAttribute("c_outlet")).getOutlet().getRiskLevel();
	trm_deposit_wired = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmDepositWired();
	trm_deposit_wireless = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmDepositWireless();
	trm_rental_deposit_wired = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmRentalDepositWired();
	trm_rental_deposit_wireless = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmRentalDepositWireless();
	trm_rental_advance = ((CaseOutlet)request.getAttribute("c_outlet")).getTrmRentalAdvance();
	cheque_amt = ((CaseOutlet)request.getAttribute("c_outlet")).getChequeAmt();
	
	String bank_issuer_branch = ((CaseOutlet)request.getAttribute("c_outlet")).getChequeIssuer();
	bank_issuer = bank_issuer_branch.substring(0, bank_issuer_branch.lastIndexOf('|'));
	bank_branch = bank_issuer_branch.substring(bank_issuer_branch.lastIndexOf('|') + 1);
	
	cheque_no = ((CaseOutlet)request.getAttribute("c_outlet")).getChequeNo();
	cheque_date = ((CaseOutlet)request.getAttribute("c_outlet")).getChequeDate();
	terminal_id = ((CaseOutlet)request.getAttribute("c_outlet")).getTerminalID();
	terminal_id_no = ((CaseOutlet)request.getAttribute("c_outlet")).getTerminalIDNo();
	terminal_install_date = ((CaseOutlet)request.getAttribute("c_outlet")).getTerminalInstallDate();
}


boolean outlet_newable = true;
boolean outlet_deletable = true;

TreeMap<String, String> viewAccess = (TreeMap<String, String>) request.getAttribute("view_access");
if(viewAccess.get("view_as").equals("maker") == false && viewAccess.get("view_as").equals("admin") == false){
	outlet_newable = false;
	outlet_deletable = false;
}

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="/jsp/map/include/html-meta.jsp" />
<script src="<%= request.getContextPath() %>/js/merchant.js"></script>
<script src="<%= request.getContextPath() %>/js/statusaction.js"></script>
<title>MAYBANK</title>
</head>

<body>

<div id="bgWrapperHome">
	<div class="headerBar">
		<div class="headerBarBorder">
			<div class="containerHome">
				<div class="logo"><a href=""><img src="resource/logo-maybank.png"></a></div>
				<div class="logdetails clearfix">
				 	<span class="logdetailsbold">Hi, <%=sUserName%>,</span>
				 	<br><%=lastLogonDateTime.equals("")?"This is your Initial Login.":"Your last login was on "+ lastLogonDateTime%>
				</div>	
			</div>
		</div>
	</div>
</div>


<div class="row-fluid page">
	<div class="span12">
		<ul class="nav nav-tabs top_tab">
			<li class="ref_no" style="float:left"><span><%= "Reference No. " + ((Casemast) request.getAttribute("m_case")).getReferenceNo() %></span></li>
		</ul>
		
		<!-- Case Transition -->
		<%
		if(request.getAttribute("status_action") != null) {
		%>
			<div class="section-header">Case Transition</div>
			<form name="caseaction" class="form caseaction">
				<input type="hidden" name="<%= Constants.TOKEN_KEY %>" value="<%= session.getAttribute(Action.TRANSACTION_TOKEN_KEY) %>" >
				<div class="row-fluid">
					<div class="span12">
						
						<table class="tblDetails"><thead>
							<tr>
								<th>Action</th>
								<th>To Status</th>
								<th>From Status</th>
								<th>Note / Comment</th>
								<th>By</th>
								<th>Date</th>
							</tr>
						</thead><tbody>
						<%
							ArrayList<TreeMap<String, String>> histArr = ((Casemast) request.getAttribute("m_case")).getHistories();
							if(histArr != null){
								int n = 0;
								for(TreeMap<String, String> histLog : histArr){
									String html = "<tr class=" + (n % 2 > 0 ? "alt" : "even") + ">"
									+ "	<td>" + histLog.get("action") + "</td>"
									+ "	<td>" + histLog.get("status") + "</td>"
									+ "	<td>" + histLog.get("last_status") + "</td>"
									+ "	<td>" + histLog.get("note") + "</td>"
									+ "	<td>" + histLog.get("created_by") + "</td>"
									+ "	<td>" + Casemast.formatCreatedDate("dd/MM/yyyy HH:mm", Long.parseLong(histLog.get("created_date"))) + "</td>"
									+ "</tr>";
									
									out.println(html);
									++n;
								}
							}
						%>
						</tbody></table>
						
					</div>
				</div>
			</form>
		
		<%
		}
		%>
		<!-- Case Transition end -->
		
		<!-- Business Detail -->
		<div class="section-header">Business Detail</div>
		<div class="row-fluid" style="margin-bottom:20px">
			<div class="span3">
				<select id="app_type">
					<%
						String html = "<option value=''>"
								+ 	"<option value='New Application'>New Application</option>"
								+ 	"<option value='Extend Facility'>Extend Facility</option>"
								+ 	"<option value='e-Commerce/M2u'>e-Commerce/M2u</option>";
								
						html = html.replace("<option value='" + app_type + "'>", "<option value='" + app_type + "' selected>");
					
						out.println(html);
					%>
				</select>
			</div>
				
			<div class="span2" style="text-align:right; line-height:20px">
				Ownership Status
			</div>
			
			<div class="span7" id="ownership_status">
				<%
					html = "<label class='radio inline-block'><input type='radio' name='ownership_status' value='Sole Proprietary' />Sole Proprietary</label>"
			    	+ "<label class='radio inline-block'><input type='radio' name='ownership_status' value='Partnership' />Partnership</label>"
					+ "<label class='radio inline-block'><input type='radio' name='ownership_status' value='Private Limited' />Private Limited</label>"
					+ "<label class='radio inline-block'><input type='radio' name='ownership_status' value='Public Listed' />Public Listed</label>"
					+ "<label class='radio inline-block'><input type='radio' name='ownership_status' value='Professional' />Professional</label>"
					+ "<label class='radio inline-block'><input type='radio' name='ownership_status' value='Government' />Government</label>"
					+ "<label class='radio inline-block'><input type='radio' name='ownership_status' value='Others' />Others</label>";
					
					html = html.replace("value='" + ownership_status + "'", "value='" + ownership_status + "' checked ");
				
					out.println(html);
				%>
			</div>
		</div>
		
		<div class="form-horizontal merchant-main-content">
			<div class="row-fluid">
				<div class="span6">
					<div class="control-group">
						<label class="control-label"><span class="must">*</span>Registered Name</label>
						<div class="controls">
							<input type="text" id="registered_name" value="<%= reg_name %>" />
						</div>
					</div>
					
					<div class="control-group">
						<label class="control-label"><span class="must">*</span>Nature of Business</label>
						<div class="controls">
							<input type="text" id="nature_of_business" value="<%= desc %>" />
						</div>
					</div>
					
					<div class="control-group">
						<label class="control-label">Paid up Capital</label>
						<div class="controls">
							<input type="text" id="paid_up_capital" value="<%= paid_up_capital %>" />
						</div>
					</div>
					
					<div class="control-group">
						<label class="control-label"><span class="must">*</span>No. of Years in Business</label>
						<div class="controls">
							<select id="years_in_business">
								<option value=""></option>
								<%
								    html = "<option value='less_than_6m'>Less than 6 months</option>"
								    	+ "<option value='more_than_6m'>More than 6 months</option>"
										+ "<option value='1y_to_3y'>1-3 Years</option>"
										+ "<option value='4y_to_7y'>4-7 Years</option>"
										+ "<option value='8y_to_10y'>8-10 Years</option>"
										+ "<option value='more_than_10y'>More than 10 Years</option>";
										
									html = html.replace("<option value='" + year_in_business + "'>", "<option value='" + year_in_business + "' selected />");
								
									out.println(html);
								%>
							</select>
						</div>
					</div>
					
					<div class="control-group">
						<label class="control-label">Average Ticket Size</label>
						<div class="controls">
							<input type="text" id="avr_ticket_size" value="<%= avg_ticket_size %>" />
						</div>
					</div>
					
					<div class="control-group">
						<label class="control-label">Current Acquirer</label>
						<div class="controls">
							<select id="current_acquirer">
								<option value=""></option>
								<% 
									html = "<option value=\"AFFIN BANK BERHAD\">AFFIN BANK BERHAD</option>"
											+ "<option value=\"ALLIANCE BANK M'SIA BHD\">ALLIANCE BANK M'SIA BHD</option>"
											+ "<option value=\"AMBANK BERHAD\">AMBANK BERHAD</option>"
											+ "<option value=\"BANK ISLAM MALAYSIA BHD\">BANK ISLAM MALAYSIA BHD</option>"
											+ "<option value=\"CIMB BANK BERHAD\">CIMB BANK BERHAD</option>"
											+ "<option value=\"CITIBANK BERHAD\">CITIBANK BERHAD</option>"
											+ "<option value=\"HONG LEONG BANK BHD\">HONG LEONG BANK BHD</option>"
											+ "<option value=\"HSBC BERHAD\">HSBC BERHAD</option>"
											+ "<option value=\"MALAYAN BANKING BERHAD\">MALAYAN BANKING BERHAD</option>"
											+ "<option value=\"OCBC BANK(M'SIA) BHD\">OCBC BANK(M'SIA) BHD</option>"
											+ "<option value=\"PUBLIC BANK BHD\">PUBLIC BANK BHD</option>"
											+ "<option value=\"RHB BANK BERHAD\">RHB BANK BERHAD</option>"
											+ "<option value=\"STANDARD CHARTERED BANK\">STANDARD CHARTERED BANK</option>"
											+ "<option value=\"UNITED OVERSEAS BANK\">UNITED OVERSEAS BANK</option>";
									
									html = html.replace("<option value=\"" + curr_acquirer + "\">", "<option value=\"" + curr_acquirer + "\" selected />");		
									out.println(html);
								%>
							</select>
						</div>
					</div>
					
					<div class="control-group">
						<label class="control-label">&#8226;&nbsp;&nbsp;Bank Name</label>
						<div class="controls">
							<select id="bank_name">
								<option value=""></option>
								<% 
									html = "<option value=\"AFFIN BANK BERHAD\">AFFIN BANK BERHAD</option>"
											+ "<option value=\"ALLIANCE BANK MALAYSIA BHD\">ALLIANCE BANK MALAYSIA BHD</option>"
											+ "<option value=\"AL-RAJHI BANKING & INVESTMENT CORP (M) BHD\">AL-RAJHI BANKING & INVESTMENT CORP (M) BHD</option>"
											+ "<option value=\"AMBANK BERHAD\">AMBANK BERHAD</option>"
											+ "<option value=\"BANK ISLAM MALAYSIA\">BANK ISLAM MALAYSIA</option>"
											+ "<option value=\"BANK KERJASAMA RAKYAT MALAYSIA BHD\">BANK KERJASAMA RAKYAT MALAYSIA BHD</option>"
											+ "<option value=\"BANK MUAMALAT\">BANK MUAMALAT</option>"
											+ "<option value=\"BANK OF AMERICA\">BANK OF AMERICA</option>"
											+ "<option value=\"BANK OF CHINA\">BANK OF CHINA</option>"
											+ "<option value=\"BANK OF TOKYO\">BANK OF TOKYO</option>"
											+ "<option value=\"BANK PERTANIAN MALAYSIA BHD (AGRO BANK)\">BANK PERTANIAN MALAYSIA BHD (AGRO BANK)</option>"
											+ "<option value=\"BANK RAKYAT MALAYSIA\">BANK RAKYAT MALAYSIA</option>"
											+ "<option value=\"BANK SIMPANAN NASIONAL BHD\">BANK SIMPANAN NASIONAL BHD</option>"
											+ "<option value=\"BNP PARIBAS MALAYSIA\">BNP PARIBAS MALAYSIA</option>"
											+ "<option value=\"CIMB BANK BERHAD\">CIMB BANK BERHAD</option>"
											+ "<option value=\"CITIBANK BERHAD\">CITIBANK BERHAD</option>"
											+ "<option value=\"DEUTSCHE BANK (M) BHD\">DEUTSCHE BANK (M) BHD</option>"
											+ "<option value=\"EON BANK BERHAD\">EON BANK BERHAD</option>"
											+ "<option value=\"HONG LEONG BANK BHD\">HONG LEONG BANK BHD</option>"
											+ "<option value=\"HSBC BANK MALAYSIA BERHAD\">HSBC BANK MALAYSIA BERHAD</option>"
											+ "<option value=\"J.P. MORGAN CHASE BANK BHD\">J.P. MORGAN CHASE BANK BHD</option>"
											+ "<option value=\"KUWAIT FINANCE HOUSE\">KUWAIT FINANCE HOUSE</option>"
											+ "<option value=\"MIZUHO CORPORATE BANK MALAYSIA\">MIZUHO CORPORATE BANK MALAYSIA</option>"
											+ "<option value=\"OCBC BANK (M) BHD\">OCBC BANK (M) BHD</option>"
											+ "<option value=\"PUBLIC BANK BHD\">PUBLIC BANK BHD</option>"
											+ "<option value=\"RHB BANK BERHAD\">RHB BANK BERHAD</option>"
											+ "<option value=\"ROYAL BANK OF SCOTLAND\">ROYAL BANK OF SCOTLAND</option>"
											+ "<option value=\"STANDARD CHARTERED BANK\">STANDARD CHARTERED BANK</option>"
											+ "<option value=\"SUMITOMO MITSUI BANK CORPORATION MALAYSIA BHD\">SUMITOMO MITSUI BANK CORPORATION MALAYSIA BHD</option>"
											+ "<option value=\"THE ROYAL BANK OF SCOTLAND BHD\">THE ROYAL BANK OF SCOTLAND BHD</option>"
											+ "<option value=\"UNITED OVERSEAS BANK BHD\">UNITED OVERSEAS BANK BHD</option>";
									
									html = html.replace("<option value=\"" + curr_bank + "\">", "<option value=\"" + curr_bank + "\" selected />");		
									out.println(html);
								%>
							</select>
						</div>
					</div>
					
					<div class="control-group" style="width:900px">
						<label class="control-label">&#8226;&nbsp;&nbsp;Current Account No.</label>
						<div class="controls">
							<input type="text" id="current_acc_no" value="<%= curr_acc_no %>" />
							<strong>&nbsp;&nbsp;&#8226;&nbsp;&nbsp;Applicable for Non-Maybank Current Account</strong>
						</div>
					</div>
					
					<div class="control-group">
						<label class="control-label">&#8226;&nbsp;&nbsp;Average Monthly Deposit</label>
						<div class="controls">
							<input type="text" id="avr_monthly_deposit" readonly="readonly" value="<%= curr_avg_deposit %>" />
						</div>
					</div>
				</div>
				
				<div class="span6">
					<div class="control-group">
						<label class="control-label">Registered No.</label>
						<div class="controls">
							<input type="text" id="registered_no" value="<%= reg_no %>" />
						</div>
					</div>
					
					<div class="control-group">
						<label class="control-label"><span class="must">*</span>MCC Code</label>
						<div class="controls">
							<input type="text" id="mcc_code" value="<%= mcc_code %>" />
						</div>
					</div>
					
					<div class="control-group">
						<label class="control-label">Recall Barcode No.</label>
						<div class="controls">
							<input type="text" id="recall_barcode_no" value="<%= recall_barcode %>" />
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<div class="row-fluid">
			<div class="span7">
				<table class="tbl monthly_deposit_tbl">
					<thead>
						<tr>
							<th style="width:32%">Month</th>
							<th style="width:34%">Total Deposit(RM)</th>
							<th style="width:34%">Balance(RM)</th>
						</tr>
					</thead>
					<tbody>
						<tr data-index="1">
							<td>
								<select name="month">
									<option value=""></option>
								<%
									html = "<option value='01'>January</option>"
										+ "<option value='02'>February</option>"
										+ "<option value='03'>March</option>"
										+ "<option value='04'>April</option>"
										+ "<option value='05'>May</option>"
										+ "<option value='06'>June</option>"
										+ "<option value='07'>July</option>"
										+ "<option value='08'>August</option>"
										+ "<option value='09'>September</option>"
										+ "<option value='10'>October</option>"
										+ "<option value='11'>November</option>"
										+ "<option value='12'>December</option>";
									
									if(avg_deposit_dtl.isEmpty() == false) {
										html = html.replace("<option value='" + avg_deposit_dtl.get(0).get("month") + "'>", "<option value='" + avg_deposit_dtl.get(0).get("month") + "' selected />");
									}
									
									out.println(html);
								%>
								</select>
							</td>
							<td><input type="text" id="total_deposit" name="total_deposit" class="number" value="<%= avg_deposit_dtl.isEmpty() == false ? avg_deposit_dtl.get(0).get("total_deposit") : "" %>" /></td>
							<td><input type="text" name="balance" class="number" value="<%= avg_deposit_dtl.isEmpty() == false ? avg_deposit_dtl.get(0).get("balance") : "" %>" /></td>
						</tr>
						
						<tr data-index="2">
							<td>
								<select name="month">
									<option value=""></option>
								<%
									html = "<option value='01'>January</option>"
										+ "<option value='02'>February</option>"
										+ "<option value='03'>March</option>"
										+ "<option value='04'>April</option>"
										+ "<option value='05'>May</option>"
										+ "<option value='06'>June</option>"
										+ "<option value='07'>July</option>"
										+ "<option value='08'>August</option>"
										+ "<option value='09'>September</option>"
										+ "<option value='10'>October</option>"
										+ "<option value='11'>November</option>"
										+ "<option value='12'>December</option>";
									
									if(avg_deposit_dtl.isEmpty() == false) {
										html = html.replace("<option value='" + avg_deposit_dtl.get(1).get("month") + "'>", "<option value='" + avg_deposit_dtl.get(1).get("month") + "' selected />");
									}
									
									out.println(html);
								%>
								</select>
							</td>
							<td><input type="text" id="total_deposit" name="total_deposit" class="number" value="<%= avg_deposit_dtl.isEmpty() == false ? avg_deposit_dtl.get(1).get("total_deposit") : "" %>" /></td>
							<td><input type="text" name="balance" class="number" value="<%= avg_deposit_dtl.isEmpty() == false ? avg_deposit_dtl.get(1).get("balance") : "" %>" /></td>
						</tr>
						
						<tr data-index="1">
							<td>
								<select name="month">
									<option value=""></option>
								<%
									html = "<option value='01'>January</option>"
										+ "<option value='02'>February</option>"
										+ "<option value='03'>March</option>"
										+ "<option value='04'>April</option>"
										+ "<option value='05'>May</option>"
										+ "<option value='06'>June</option>"
										+ "<option value='07'>July</option>"
										+ "<option value='08'>August</option>"
										+ "<option value='09'>September</option>"
										+ "<option value='10'>October</option>"
										+ "<option value='11'>November</option>"
										+ "<option value='12'>December</option>";
									
									if(avg_deposit_dtl.isEmpty() == false) {
										html = html.replace("<option value='" + avg_deposit_dtl.get(2).get("month") + "'>", "<option value='" + avg_deposit_dtl.get(2).get("month") + "' selected />");
									}
									
									out.println(html);
								%>
								</select>
							</td>
							<td><input type="text" id="total_deposit" name="total_deposit" class="number" value="<%= avg_deposit_dtl.isEmpty() == false ? avg_deposit_dtl.get(2).get("total_deposit") : "" %>" /></td>
							<td><input type="text" name="balance" class="number" value="<%= avg_deposit_dtl.isEmpty() == false ? avg_deposit_dtl.get(2).get("balance") : "" %>" /></td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		
		<div class="form-horizontal three-col" style="margin-top:30px">
			<h4>Amex Authorised Signatories</h4>
			<table class="tbl amex_auth_sign_tbl">
				<tr>
					<td>Title</td>
					<td>
						<select id="title_1">
							<option value=""></option>
							<%
								html = "<option value=''>Unknown</option>"
									+ "<option value='Mr'>Mr</option>"
									+ "<option value='Mrs'>Mrs</option>"
									+ "<option value='Miss'>Miss</option>"
									+ "<option value='Dato'>Dato</option>"
									+ "<option value='Datin'>Datin</option>"
									+ "<option value='Datuk'>Datuk</option>"
									+ "<option value='Tan Sri'>Tan Sri</option>"
									+ "<option value='Puan Sri'>Puan Sri</option>"
									+ "<option value='Y.B.'>Y.B.</option>"
									+ "<option value='Tuanku'>Tuanku</option>";
								
								if(amex_entries.isEmpty() == false) {
									html = html.replace("<option value='" + amex_entries.get(0).get("title") + "'>", "<option value='" + amex_entries.get(0).get("title") + "' selected />");
								}
								
								out.println(html);
							%>
						</select>
					</td>
					
					<td>Designation</td>
					<td><input type="text" id="designation_1" value="<%= amex_entries.isEmpty() == false && amex_entries.get(0).get("designation").equals("0") == false ? amex_entries.get(0).get("designation") : "" %>" /></td>
					
					<td>Date of Birth</td>
					<td><input type="text" id="dob_1" value="<%= amex_entries.isEmpty() == false ? amex_entries.get(0).get("dob") : "" %>" /></td>
				</tr>
				
				<tr>
					<td>Name</td>
					<td><input type="text" id="name_1" value="<%= amex_entries.isEmpty() == false ? amex_entries.get(0).get("name") : "" %>" /></td>
					
					<td>New IC No./Passpost No.</td>
					<td><input type="text" id="ic_1" value="<%= amex_entries.isEmpty() == false ? amex_entries.get(0).get("ic") : "" %>" /></td>
					
					<td>Gender</td>
					<td>
						<select id="gender_1">
							<%
								html = "<option value='0'></option>"
									+ "<option value='Male'>Male</option>"
									+ "<option value='Female'>Female</option>";
								
								if(amex_entries.isEmpty() == false) {
									html = html.replace("<option value='" + amex_entries.get(0).get("gender") + "'>", "<option value='" + amex_entries.get(0).get("gender") + "' selected />");
								}
								
								out.println(html);
							%>
						</select>
					</td>
				</tr>
				
				<tr class="padding">
					<td>Title</td>
					<td>
						<select id="title_2">
							<option value=""></option>
							<%
							html = "<option value=''>Unknown</option>"
									+ "<option value='Mr'>Mr</option>"
									+ "<option value='Mrs'>Mrs</option>"
									+ "<option value='Miss'>Miss</option>"
									+ "<option value='Dato'>Dato</option>"
									+ "<option value='Datin'>Datin</option>"
									+ "<option value='Datuk'>Datuk</option>"
									+ "<option value='Tan Sri'>Tan Sri</option>"
									+ "<option value='Puan Sri'>Puan Sri</option>"
									+ "<option value='Y.B.'>Y.B.</option>"
									+ "<option value='Tuanku'>Tuanku</option>";
								
								if(amex_entries.isEmpty() == false) {
									html = html.replace("<option value='" + amex_entries.get(1).get("title") + "'>", "<option value='" + amex_entries.get(1).get("title") + "' selected />");
								}
								
								out.println(html);
							%>
						</select>
					</td>
					
					<td>Designation</td>
					<td><input type="text" id="designation_2" value="<%= amex_entries.isEmpty() == false && amex_entries.get(1).get("designation").equals("0") == false ? amex_entries.get(1).get("designation") : "" %>" /></td>
					
					<td>Date of Birth</td>
					<td><input type="text" id="dob_2" value="<%= amex_entries.isEmpty() == false ? amex_entries.get(1).get("dob") : "" %>" /></td>
				</tr>
				
				<tr>
					<td>Name</td>
					<td><input type="text" id="name_2" value="<%= amex_entries.isEmpty() == false ? amex_entries.get(1).get("name") : "" %>" /></td>
					
					<td>New IC No./Passpost No.</td>
					<td><input type="text" id="ic_2" value="<%= amex_entries.isEmpty() == false ? amex_entries.get(1).get("ic") : "" %>" /></td>
					
					<td>Gender</td>
					<td>
						<select id="gender_2">
							<%
								html = "<option value='0'></option>"
									+ "<option value='Male'>Male</option>"
									+ "<option value='Female'>Female</option>";
								
								if(amex_entries.isEmpty() == false) {
									html = html.replace("<option value='" + amex_entries.get(1).get("gender") + "'>", "<option value='" + amex_entries.get(1).get("gender") + "' selected />");
								}
								
								out.println(html);
							%>
						</select>
					</td>
				</tr>
			</table>

		</div>
		<!-- Business Detail end -->

		<!-- MATCH / TRACE -->
		<div class="section-header">MATCH / TRACE</div>
		<div class="form-horizontal merchant-main-content" style="overflow-y:auto; overflow-x:hidden">
			<div class="row-fluid">
				<div class="span12">
					<table class="tbl match_trace_tbl" style="width:98%">
						<thead>
							<tr>
								<th style="width:20%">First Name</th>
								<th style="width:20%">Last Name</th>
								<th style="width:20%">Owner IC/Passport</th>
								<th style="width:20%">Nationality</th>
								<th style="width:20%">Country Code</th>
								<th style="width:20%"><a href="">Add</a></th>
							</tr>
						</thead>
						<tbody>
							<% 
								if(match_trace.length() > 0) {
									JSONArray arr = (JSONArray) JSONValue.parse(match_trace);
									for(int k = 0; k < arr.size(); k++) {
								    	String string = arr.get(k).toString();
								    	JSONObject obj = (JSONObject)JSONValue.parse(string);
		
								    	String f_name = (obj.get("f_name") == null) ? "" : obj.get("f_name").toString().trim();
								    	String l_name = (obj.get("l_name") == null) ? "" : obj.get("l_name").toString().trim();
								    	String ic = (obj.get("ic") == null) ? "" : obj.get("ic").toString().trim();
								    	String nationality = (obj.get("nationality") == null) ? "" : obj.get("nationality").toString().trim();
								    	String country_code = (obj.get("country_code") == null) ? "" : obj.get("country_code").toString().trim();
								    	
								    	html = "<tr data-index=" + k+1 + ">"
											+	"<td><input type='text' name='f_name' value='" + f_name + "' /></td>"
											+	"<td><input type='text' name='l_name' value='" + l_name + "' /></td>"
											+	"<td><input type='text' name='ic' value='" + ic + "' /></td>"
											+	"<td><select name='nationality'>" + nationality_opt + "</select></td>"
											+	"<td><input type='text' name='country_code' value='" + country_code + "' readonly='readonly' /></td>";
										
										if(k > 0) {
											html += "<td><a href=''>Delete</a></td>";
										}
										else {
											html += "<td></td>";
										}
										
										html = html.replace("<option value='" + nationality + "'>", "<option value='" + nationality + "' selected>");
										
										out.println(html);
									}
								}
								else {
									html = "<tr data-index='1'>"
										+	"<td><input type='text' name='f_name' /></td>"
										+	"<td><input type='text' name='l_name' /></td>"
										+	"<td><input type='text' name='ic' /></td>"
										+	"<td><select name='nationality'>" + nationality_opt + "</select></td>"
										+	"<td><input type='text' name='country_code' readonly='readonly' value='MYS' /></td>"
										+	"<td><a href=''>Delete</a></td>";
										
									out.println(html);
								}
							
								
							%>
						
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<!-- MATCH / TRACE end -->
		
		<!-- Outlet Detail -->
		<div class="section-header">Outlet</div>
		<%
			String css_class = "";
			
			for(CaseOutlet a : ((Casemast)request.getAttribute("m_case")).getOutlets()){
				Outlet o = a.getOutlet();
				
				html = "<div class=\"form-horizontal main-content\">"
				+	"<div class=\"row-fluid\" style=\"width:1000px\">"
				+	"	<div class=\"span5\">"
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">Trading Name</label>"
				+	"			<div class=\"controls\">"
				+	"				<input type=\"text\" id=\"trading_name\" value=\"" + o.getName() + "\" />"
				+	"			</div>"
				+	"		</div>"			
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">Registered Name</label>"
				+	"			<div class=\"controls\">"
				+	"				<input type=\"text\" id=\"registered_name\" value=\"" + o.getMerchant().getRegisteredName() + "\" />"
				+	"			</div>"
				+	"		</div>"
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">Business Registration No.</label>"
				+	"			<div class=\"controls\">"
				+	"				<input type=\"text\" id=\"business_reg_no\" value=\"" + o.getMerchant().getRegisteredNo() + "\" />"
				+	"			</div>"
				+	"		</div>"
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">Contact Person</label>"
				+	"			<div class=\"controls\">"
				+	"				<input type=\"text\" id=\"contact_person\" value=\"" + o.getCTName() + "" />"
				+	"			</div>"
				+	"		</div>"
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">Designation</label>"
				+	"			<div class=\"controls\">"
				+	"				<input type=\"text\" id=\"designation\" value=\"" + o.getCTDesignation() + "\" />"
				+	"			</div>"
				+	"		</div>"
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">Email</label>"
				+	"			<div class=\"controls\">"
				+	"				<input type=\"text\" id=\"email\" value=\"" + o.getCTEmail() + "\" />"
				+	"			</div>"
				+	"		</div>"
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">Telephone No</label>"
				+	"			<div class=\"controls\">"
				+	"				<input type=\"text\" id=\"telephone_no\" value=\"" + o.getCTTel() + "\" />"
				+	"			</div>"
				+	"		</div>"
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">Fax No.</label>"
				+	"			<div class=\"controls\">"
				+	"				<input type=\"text\" id=\"fax_no\" value=\"" + o.getCTFax() + "\" />"
				+	"			</div>"
				+	"		</div>"
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">ESA Reference No.</label>"
				+	"			<div class=\"controls\">"
				+	"				<input type=\"text\" id=\"esa_ref_no\" value=\"" + a.getESARefNo() + "\" />"
				+	"			</div>"
				+	"		</div>"
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">No. of Terminal</label>"
				+	"			<div class=\"controls\">"
				+	"				<input type=\"text\" id=\"no_of_terminal\" value=\"" + a.getNumTerminal() + "\" />"
				+	"			</div>"
				+	"		</div>"
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">Terminal Rental Fee</label>"
				+	"			<div class=\"controls\">"		
				+	"				<select id=\"terminal_rental_fee\">";
									
									html += "<option value=\"00\">00 - no TRF</option>"
										+ "<option value=\"01\">01 - RM 180</option>"
										+ "<option value=\"02\">02 - RM 150</option>"
										+ "<option value=\"03\">03 - RM 100</option>"
										+ "<option value=\"04\">04 - RM 170</option>"
										+ "<option value=\"05\">05 - RM 190</option>"
										+ "<option value=\"06\">06 - RM 129</option>"
										+ "<option value=\"07\">07 - RM 200</option>"
										+ "<option value=\"08\">08 - RM 250</option>"
										+ "<option value=\"09\">09 - RM 80</option>"
										+ "<option value=\"10\">10 - RM 75</option>"
										+ "<option value=\"11\">11 - RM 70</option>"
										+ "<option value=\"12\">12 - RM 60</option>"
										+ "<option value=\"13\">13 - RM 55</option>"
										+ "<option value=\"14\">14 - RM 50</option>"
										+ "<option value=\"15\">15 - RM 140</option>"
										+ "<option value=\"16\">16 - RM 90</option>"
										+ "<option value=\"17\">17 - RM 175</option>"
										+ "<option value=\"18\">18 - RM 160</option>"
										+ "<option value=\"19\">19 - (F) RM 100 (W) RM 150</option>"
										+ "<option value=\"20\">20 - RM 165</option>"
										+ "<option value=\"21\">21 - (F) RM 80 (W) RM 180</option>"
										+ "<option value=\"22\">22 - (F) RM 80 (W) RM 175</option>"
										+ "<option value=\"23\">23 - (F) RM 100 (W) RM 175</option>"
										+ "<option value=\"24\">24 - (F) RM 100 (W) RM 150</option>"
										+ "<option value=\"25\">25 - (F) RM 60 (W) RM 100</option>"
										+ "<option value=\"26\">26 - RM 130</option>"
										+ "<option value=\"27\">27 - (F) RM 80  (W) RM140</option>"
										+ "<option value=\"28\">28 - (F) RM 80 (W) RM 150</option>"
										+ "<option value=\"29\">29 - RM 110</option>"
										+ "<option value=\"30\">30 - RM 125</option>"
										+ "<option value=\"31\">31 - RM 120</option>"
										+ "<option value=\"32\">32 - (F) RM 55 (W) RM 180</option>"
										+ "<option value=\"33\">33 - (F) RM 80 (W) RM 150</option>"
										+ "<option value=\"34\">34 - RM 38</option>"
										+ "<option value=\"35\">35 - (F) RM 80 (W) RM 100</option>"
										+ "<option value=\"36\">36 - (F) RM55 (W) RM180</option>"
										+ "<option value=\"37\">37 - (F) RM55 (F) RM 80</option>"
										+ "<option value=\"38\">38 - RM135</option>"
										+ "<option value=\"39\">39 - (F) RM80 (W) RM180</option>"
										+ "<option value=\"40\">40 - (F) RM55 (W) RM150</option>"
										+ "<option value=\"41\">41 - (F) RM50 (W) RM80</option>"
										+ "<option value=\"42\">42 - (F) RM80 (W) RM130</option>"
										+ "<option value=\"43\">43 - (F) RM55 (W) RM130</option>"
										+ "<option value=\"44\">44 - (F) RM80 (W) RM120</option>"
										+ "<option value=\"45\">45 - RM35</option>"
										+ "<option value=\"46\">46 - (F) RM80 (W) RM135</option>"
										+ "<option value=\"47\">47 - (F) RM60 (W) RM150</option>"
										+ "<option value=\"48\">48 - (F) RM60 (W) RM120</option>"
										+ "<option value=\"49\">49 - (F) RM60 (W) RM180</option>"
										+ "<option value=\"50\">50 - RM40</option>"
										+ "<option value=\"51\">51 - (F) RM80 (W) RM125</option>"
										+ "<option value=\"52\">52 - RM65</option>"
										+ "<option value=\"53\">53 - RM10</option>";	
										
									html = html.replace("value=\"" + a.getTrmRental() + "\"", "value=\"" + a.getTrmRental() + "\" selected ");
														
				html +=	"			</select>"
				+	"			</div>"
				+	"		</div>"
				+	"		<div class=\"control-group\">"
				+	"			<label class=\"control-label\">Terminal Owner</label>"
				+	"			<div class=\"controls\">"
				+	"				<select id=\"terminal_owner\">";
				
									<%
										html = \"<option value=\\"00\\">00 - Not Available</option>\"
											+ \"<option value=\\"01\\">01 - Maybank</option>\"
											+ \"<option value=\\"02\\">02 - Paysys</option>\"
											+ \"<option value=\\"03\\">03 - ESA </option>\"
											+ \"<option value=\\"04\\">04 - Maybank & Paysys</option>\"
											+ \"<option value=\\"05\\">05 - ESA (Wired) & Paysys (Wireless)</option>\"
											+ \"<option value=\\"06\\">06 - Maybank & GHL (Wireless)</option>\"
											+ \"<option value=\\"07\\">07 - Maybank Phillipines</option>\"
											+ \"<option value=\\"08\\">08 - Maybank Singapore</option>\";						
										
										html = html.replace(\"value=\\"\" + terminal_owner + \"\\"\", \"value=\\"\" + terminal_owner + \"\\" selected \");
										
										out.println(html);
									%>
									</select>
								</div>
							</div>
						</div>
						
						<div class=\"span5\">
							<div class=\"control-group\">
								<label class=\"control-label\">Business License No.</label>
								<div class=\"controls\">
									<input type=\"text\" id=\"business_license_no\" value=\"<%= license_no %>\" />
								</div>
							</div>
							
							<div class=\"control-group\" style=\"text-align:right\" id=\"license_type\">
							<%
								html = \"<label class=\\"radio inline-block\\"><input type=\\"radio\\" name=\\"business_license_type\\" value=\\"permanent\\" />Permanent</label>\"
								+ \"<label class=\\"radio inline-block\\"><input type=\\"radio\\" name=\\"business_license_type\\" value=\\"temporary\\" />Temporary</label>\"
								+ \"<label class=\\"radio inline-block\\"><input type=\\"radio\\" name=\\"business_license_type\\" value=\\"na\\" />N/A</label>\";
								
								html = html.replace(\"value=\\"\" + license_type + \"\\"\", \"value=\\"\" + license_type + \"\\" checked \");
					
								out.println(html);
							%>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">State</label>
								<div class=\"controls\">
									<select id=\"state\" onchange=\"outlet.load_state_issuer(this.value, '');\">
										<option value=\"\"></option>
										<%
											html = \"<option value=\\"WILAYAH PERSEKUTUAN KUALA LUMPUR\\">WILAYAH PERSEKUTUAN KUALA LUMPUR</option>\"
												+ \"<option value=\\"SELANGOR\\">SELANGOR</option>\"
												+ \"<option value=\\"KEDAH\\">KEDAH</option>\"
												+ \"<option value=\\"PERLIS\\">PERLIS</option>\"
												+ \"<option value=\\"PULAU PINANG\\">PULAU PINANG</option>\"
												+ \"<option value=\\"PERAK\\">PERAK</option>\"
												+ \"<option value=\\"NEGERI SEMBILAN\\">NEGERI SEMBILAN</option>\"
												+ \"<option value=\\"MELAKA\\">MELAKA</option>\"
												+ \"<option value=\\"JOHOR\\">JOHOR</option>\"
												+ \"<option value=\\"TERENGGANU\\">TERENGGANU</option>\"
												+ \"<option value=\\"PAHANG\\">PAHANG</option>\"
												+ \"<option value=\\"KELANTAN\\">KELANTAN</option>\"
												+ \"<option value=\\"SABAH\\">SABAH</option>\"
												+ \"<option value=\\"SARAWAK\\">SARAWAK</option>\"
												+ \"<option value=\\"WILAYAH PERSEKUTUAN PUTRAJAYA\\">WILAYAH PERSEKUTUAN PUTRAJAYA</option>\"
												+ \"<option value=\\"WILAYAH PERSEKUTUAN LABUAN\\">WILAYAH PERSEKUTUAN LABUAN</option>\";
											
											html = html.replace(\"value=\\"\" + state + \"\\"\", \"value=\\"\" + state + \"\\" selected \");
					
											out.println(html);
										%>
									</select>
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Issuer</label>
								<div class=\"controls\">
									<select id=\"issuer\">
										<!-- <jsp:include page=\"include/municipal-council-options.jsp\">
											<jsp:param name=\"issuer\" value=\"<%= issuer %>\" />
										</jsp:include> -->
									</select>
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Expiry Date</label>
								<div class=\"controls\">
									<input type=\"text\" id=\"expiry_date\" value=\"<%= expiry %>\" placeholder=\"ddmmyyyy\" />
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Risk Level</label>
								<div class=\"controls\">
									<select id=\"risk_level\">
										<option value=\"\"></option>
										<% 
											html = \"<option value=\\"HI\\">HI</option>\"
												 + \"<option value=\\"ME\\">ME</option>\"
												 + \"<option value=\\"LO\\">LO</option>\";
												 
											html = html.replace(\"value=\\"\" + risk_level + \"\\"\", \"value=\\"\" + risk_level + \"\\" selected \");
													
											out.println(html);
										%>
									</select>
								</div>
							</div>
							
							<div class=\"control-group\" style=\"background-color:#eee; text-align:center\">
								<label class=\"control-label\" style=\"font-weight:bold; float:none; display:inline-block; text-align:center\">Terminal Fee</label>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Terminal Deposit (Wired)</label>
								<div class=\"controls\">
									<input type=\"text\" id=\"terminal_deposit_wired\" value=\"<%= trm_deposit_wired %>\" />
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Terminal Deposit (Wireless)</label>
								<div class=\"controls\">
									<input type=\"text\" id=\"terminal_deposit_wireless\" value=\"<%= trm_deposit_wireless %>\" />
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Terminal Rental Deposit (Wired)</label>
								<div class=\"controls\">
									<input type=\"text\" id=\"terminal_rental_deposit_wired\" value=\"<%= trm_rental_deposit_wired %>\" />
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Terminal Rental Deposit (Wireless)</label>
								<div class=\"controls\">
									<input type=\"text\" id=\"terminal_rental_deposit_wireless\" value=\"<%= trm_rental_deposit_wireless %>\" />
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Advance Terminal Rental</label>
								<div class=\"controls\">
									<input type=\"text\" id=\"advance_terminal_rental\" value=\"<%= trm_rental_advance %>\" />
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Total Cheque Amount</label>
								<div class=\"controls\">
									<input type=\"text\" id=\"total_cheque_amt\" value=\"<%= cheque_amt %>\" />
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Bank Issuer / Branch</label>
								<div class=\"controls\">
									<select id=\"bank_issuer\" style=\"width:99px\">
										<option value=\"\"></option>
										<% 
											html = \"<option value=\\"AFFIN BANK BERHAD\\">AFFIN BANK BERHAD</option>\"
													+ \"<option value=\\"ALLIANCE BANK MALAYSIA BHD\\">ALLIANCE BANK MALAYSIA BHD</option>\"
													+ \"<option value=\\"AL-RAJHI BANKING & INVESTMENT CORP (M) BHD\\">AL-RAJHI BANKING & INVESTMENT CORP (M) BHD</option>\"
													+ \"<option value=\\"AMBANK BERHAD\\">AMBANK BERHAD</option>\"
													+ \"<option value=\\"BANK ISLAM MALAYSIA\\">BANK ISLAM MALAYSIA</option>\"
													+ \"<option value=\\"BANK KERJASAMA RAKYAT MALAYSIA BHD\\">BANK KERJASAMA RAKYAT MALAYSIA BHD</option>\"
													+ \"<option value=\\"BANK MUAMALAT\\">BANK MUAMALAT</option>\"
													+ \"<option value=\\"BANK OF AMERICA\\">BANK OF AMERICA</option>\"
													+ \"<option value=\\"BANK OF CHINA\\">BANK OF CHINA</option>\"
													+ \"<option value=\\"BANK OF TOKYO\\">BANK OF TOKYO</option>\"
													+ \"<option value=\\"BANK PERTANIAN MALAYSIA BHD (AGRO BANK)\\">BANK PERTANIAN MALAYSIA BHD (AGRO BANK)</option>\"
													+ \"<option value=\\"BANK RAKYAT MALAYSIA\\">BANK RAKYAT MALAYSIA</option>\"
													+ \"<option value=\\"BANK SIMPANAN NASIONAL BHD\\">BANK SIMPANAN NASIONAL BHD</option>\"
													+ \"<option value=\\"BNP PARIBAS MALAYSIA\\">BNP PARIBAS MALAYSIA</option>\"
													+ \"<option value=\\"CIMB BANK BERHAD\\">CIMB BANK BERHAD</option>\"
													+ \"<option value=\\"CITIBANK BERHAD\\">CITIBANK BERHAD</option>\"
													+ \"<option value=\\"DEUTSCHE BANK (M) BHD\\">DEUTSCHE BANK (M) BHD</option>\"
													+ \"<option value=\\"EON BANK BERHAD\\">EON BANK BERHAD</option>\"
													+ \"<option value=\\"HONG LEONG BANK BHD\\">HONG LEONG BANK BHD</option>\"
													+ \"<option value=\\"HSBC BANK MALAYSIA BERHAD\\">HSBC BANK MALAYSIA BERHAD</option>\"
													+ \"<option value=\\"J.P. MORGAN CHASE BANK BHD\\">J.P. MORGAN CHASE BANK BHD</option>\"
													+ \"<option value=\\"KUWAIT FINANCE HOUSE\\">KUWAIT FINANCE HOUSE</option>\"
													+ \"<option value=\\"MALAYAN BANKING BERHAD\\">MALAYAN BANKING BERHAD</option>\"
													+ \"<option value=\\"MIZUHO CORPORATE BANK MALAYSIA\\">MIZUHO CORPORATE BANK MALAYSIA</option>\"
													+ \"<option value=\\"OCBC BANK (M) BHD\\">OCBC BANK (M) BHD</option>\"
													+ \"<option value=\\"PUBLIC BANK BHD\\">PUBLIC BANK BHD</option>\"
													+ \"<option value=\\"RHB BANK BERHAD\\">RHB BANK BERHAD</option>\"
													+ \"<option value=\\"ROYAL BANK OF SCOTLAND\\">ROYAL BANK OF SCOTLAND</option>\"
													+ \"<option value=\\"STANDARD CHARTERED BANK\\">STANDARD CHARTERED BANK</option>\"
													+ \"<option value=\\"SUMITOMO MITSUI BANK CORPORATION MALAYSIA BHD\\">SUMITOMO MITSUI BANK CORPORATION MALAYSIA BHD</option>\"
													+ \"<option value=\\"THE ROYAL BANK OF SCOTLAND BHD\\">THE ROYAL BANK OF SCOTLAND BHD</option>\"
													+ \"<option value=\\"UNITED OVERSEAS BANK BHD\\">UNITED OVERSEAS BANK BHD</option>\";
											
											html = html.replace(\"<option value=\\"\" + bank_issuer + \"\\">\", \"<option value=\\"\" + bank_issuer + \"\\" selected />\");		
											out.println(html);
										%>
									</select>
									<input type=\"text\" id=\"bank_branch\" style=\"width:79px\" value=\"<%= bank_branch %>\"/>
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Cheque No. / Cheque Date</label>
								<div class=\"controls\">
									<input type=\"text\" id=\"cheque_no\" style=\"width:110px\" value=\"<%= cheque_no %>\"/>
									<input type=\"text\" id=\"cheque_date\" style=\"width:79px\" placeholder=\"ddmmyyyy\" value=\"<%= cheque_date %>\"/>
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Terminal ID</label>
								<div class=\"controls\">
									<input type=\"text\" id=\"terminal_id\" style=\"width:145px\" value=\"<%= terminal_id %>\"/>
									<input type=\"text\" id=\"terminal_id_no\" style=\"width:44px\" value=\"<%= terminal_id_no %>\"/>
								</div>
							</div>
							
							<div class=\"control-group\">
								<label class=\"control-label\">Terminal Installation Date</label>
								<div class=\"controls\">
									<input type=\"text\" id=\"terminal_install_date\" value=\"<%= terminal_install_date %>\"/>
								</div>
							</div>
						</div>
					</div>
				</div>";
				
				out.println(html);
			}
		%>
		<!-- Outlet Detail end -->
	</div>
</div>

<!-- Footer -->
<%@ include file="/jsp/common/Footer.jsp" %>	
<!-- End Footer -->


</body>
</html>